﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using MixModes.Synergy.Web.VisualFramework.Windows;

namespace MixModes.Synergy.Web
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private int i;

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DockPane pane = new DockPane();
            pane.MinHeight = 24;
            pane.MinWidth = 100;
            pane.Header = "Solution Explorer";
            Grid g = new Grid();
            g.Background = new SolidColorBrush(Colors.White);
            TextBlock text = new TextBlock();
            text.Text = "Some content - " + (i + 1);
            g.Children.Add(text);
            pane.Content = g;
            Dock direction = Dock.Top;
            if (i % 4 == 1)
                direction = Dock.Right;
            else if (i % 4 == 2)
                direction = Dock.Left;
            else if (i % 4 == 3)
                direction = Dock.Bottom;
            i++;

            pane.Tag = i;

            pane.MouseEnter += (a, b) =>
            {
                var x = WindowsManager;
                System.Diagnostics.Debug.WriteLine((a as DockPane).Tag);
            };

            WindowsManager.AddPinnedWindow(pane, direction);            

        }

        private void Button_Save(object sender, RoutedEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void Button_Load(object sender, RoutedEventArgs e)
        {
            throw new NotImplementedException();
        }
    }
}
